<template>
  <div>
   <button @click="show">点击</button>
   <p>{{ arr[num] }}</p>
  </div>
</template>

<script>
export default {
 data() {
  return {
    arr : ["小花", "小明", "小可爱", "小王"],
    num : ''
  }
 },
 methods: {
  show() {
   let max = this.arr.length - 1 
   let min = 0
   this.num = Math.floor(Math.random() * (max - min + 1) )
  }
 }
}
</script>

<style>

</style>